from plone.app.testing import PloneSandboxLayer
from plone.app.testing import applyProfile
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import IntegrationTesting

from zope.configuration import xmlconfig

class PlumVillageRegistrationContent(PloneSandboxLayer):

    defaultBases = (PLONE_FIXTURE,)
    
    def setUpZope(self, app, configurationContext):
        # Load ZCML
        import plumvillage.registration
        xmlconfig.file('configure.zcml', plumvillage.registration, context=configurationContext)
    
    def setUpPloneSite(self, portal):
        applyProfile(portal, 'plumvillage.registration:default')

PLUMVILLAGE_REGISTRATIONCONTENT_FIXTURE = PlumVillageRegistrationContent()
PLUMVILLAGE_REGISTRATIONCONTENT_INTEGRATION_TESTING = IntegrationTesting(bases=(PLUMVILLAGE_REGISTRATIONCONTENT_FIXTURE,), name="PlumVillageRegistrationContent:Integration")
